package com.gxa.modules.app.hospitalization.feedBack.controller;

import com.gxa.common.utils.Result;
import com.gxa.modules.app.hospitalization.feedBack.service.FeedBackService;
import com.gxa.modules.model.entity.hospital.Feedback;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@Api(tags = "增加问题反馈")
@RestController
@RequestMapping("/addFeedBack")
public class FeedBackController {
    @Autowired
    private FeedBackService feedBackService;
    @PostMapping("/add")
    @ApiOperation("问题反馈")
    public Result addFeedBack(@RequestBody Feedback feedback){
        try {
            feedBackService.add(feedback);
            return new Result().ok();
        } catch (Exception e) {
            e.printStackTrace();
            return new Result().error();
        }

    }
}
